#include <iostream>
#include <fstream>
#include <conio.h>

using namespace std;

int main()
{
    string tekst;
    int dl;
    int klucz=8;
    char c;





    cout << " podaj tekst ->";
    getline(cin, tekst);


    cout << "\n podaj klucz  "; cin >> klucz;



    cout << "\n   --> " << tekst<< endl;
    dl=tekst.length();

    for( int i =0; i < dl; i++)
    {
        c = tekst[i];
        if (c== ' ' ) ;
        else
        {
            tekst[i]+= klucz;

        if (c-klucz > 'z' )  tekst[i]-=26;}
    }

    cout<< "\n zakodowano ->"<< tekst;

    return 0;
}
